Internet data looks like an I/O stream.
The core Java language does not have any I/O methods.
For a program to do I/O, it must import
an I/O
package.
These notes (and most programs) use the package java.io
.
Data for a program may come from several sources. Data created by a program may be sent to several destinations. The connection between a program and a data source or destination is called a stream.
An input stream handles data flowing into a program. An output stream handles data flowing out of a program.
In the picture, each "O" is a piece of data. The data are streaming from the source into the program. Computed results are streaming from the program to the destination.
Could a disk file be an input stream?